{% extends "deportes/base.html" %}

{% block title %}Deportes{% endblock %}

{% block extrahead %}
    {% load static %}
    {% get_static_prefix as STATIC_PREFIX %}
    <!--     jquery/../css's    -->
    <link rel="stylesheet" type="text/css" media="screen" href="{{ STATIC_PREFIX }}css/jquery/ui/jquery-ui-1.8.16.custom.css" />
    <link rel="stylesheet" type="text/css" media="screen" href="{{ STATIC_PREFIX }}css/jquery/ui/jquery.ui.jqgrid.css" />
    
    <!--     jquery/../js's    -->
    <script src="{{ STATIC_PREFIX }}js/jquery/jquery-1.7.min.js" type="text/javascript"></script>
    <script src="{{ STATIC_PREFIX }}js/jquery/jqGrid/i18n/grid.locale-es.js" type="text/javascript"></script>
    <script src="{{ STATIC_PREFIX }}js/jquery/jqGrid/jquery.jqGrid.js" type="text/javascript"></script>
    <script src="{{ STATIC_PREFIX }}js/common.js" type="text/javascript"></script>
    <!-- ......................... -->
	
    <!--     jquery/tablesorter    -->
    <script type="text/javascript">
        $(document).ready(function() { 
            $.getJSON("/deportes/lista/cfg/", function(data){
                data['sortname'] = 'nombre',
                data["colNames"] = ['Id','Nombre'];
                $("#mygrid")
                .jqGrid(data)
                .navGrid('#pager', 
                    {add: false, edit: false, del: false, view: false},
                    {}, // edit options
                    {}, // add options
                    {}, // del options 
                    {multipleSearch:true, closeOnEscape:true, drag:true, closeAfterSearch: true}, // search options 
                    {} // view options 
                );
                jQuery("#mygrid").jqGrid('navGrid',"#pager").jqGrid('navButtonAdd',"#pager",{caption:"Editar", buttonicon:"ui-icon-newwin", onClickButton:(function(event) {llamar_formulario('/deportes/editar/','')}), position:'first' ,title:"Editar"});
                jQuery("#mygrid").jqGrid('navGrid',"#pager").jqGrid('navButtonAdd',"#pager",{caption:"Ver", buttonicon:"ui-icon-newwin", onClickButton:(function(event) {llamar_formulario('/deportes/ver/','')}), position:'first' ,title:"Ver"});
            });
        });
    </script>
{% endblock %}

{% block breadcrumb %} <a href="/">Inicio</a> > Deportes {% endblock %}

{% block content %}
<div class='buttons' align='right'>
    <!input type='submit' value='Inicio' onclick="document.location = '../';">
    <input type='submit' value='Agregar deporte' onclick="document.location = '/deportes/nuevo/';">
</div>

<div class="main">
    <div id="jqgrid">
        <table id="mygrid"></table>
        <div id="pager"></div>
    </div>
</div>
{% endblock %}
